package eqpkanban
/**
 * @Program: eqpkanban
 * @Description: 图形初始化
 * @Author: 樊双峰
 * @Date: 2018-07-03 22:18
 */
class GraphInitUtil {

    def graphInit(){
        def rectSql = new Graph(graphName: "rect", graphDesc: "矩形")
        def circleSql = new Graph(graphName: "circle", graphDesc: "圆形")
        def ovalSql = new Graph(graphName: "oval", graphDesc: "椭圆形")
        def roundRectSql = new Graph(graphName: "roundRect", graphDesc: "圆角矩形")
        def triangleSql = new Graph(graphName: "triangle", graphDesc: "三角形")
        def rightTriangleSql = new Graph(graphName: "rightTriangle", graphDesc: "直角三角形")
        def hexagonSql = new Graph(graphName: "hexagon", graphDesc: "六边形")
        def pentagonSql = new Graph(graphName: "pentagon", graphDesc: "五边形")
        def trapezoidSql = new Graph(graphName: "trapezoid", graphDesc: "梯形")
        def rect = "rect"
        def circle = "circle"
        def oval = "oval"
        def roundRect = "roundRect"
        def triangle = "triangle"
        def rightTriangle = "rightTriangle"
        def pentagon = "pentagon"
        def hexagon = "hexagon"
        def trapezoid = "trapezoid"
        if ((Graph.list().graphName).contains(rect.trim()) == false) {
            rectSql.save()
        } else if ((Graph.list().graphName).contains(circle.trim()) == false) {
            circleSql.save()
        } else if ((Graph.list().graphName).contains(oval.trim()) == false) {
            ovalSql.save()
        } else if ((Graph.list().graphName).contains(roundRect.trim()) == false) {
            roundRectSql.save()
        } else if ((Graph.list().graphName).contains(triangle.trim()) == false) {
            triangleSql.save()
        } else if ((Graph.list().graphName).contains(rightTriangle.trim()) == false) {
            rightTriangleSql.save()
        } else if ((Graph.list().graphName).contains(hexagon.trim()) == false) {
            hexagonSql.save()
        } else if ((Graph.list().graphName).contains(pentagon.trim()) == false) {
            pentagonSql.save()
        } else if ((Graph.list().graphName).contains(trapezoid.trim()) == false) {
            trapezoidSql.save()
        }
    }
}